#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
    int n;
    int a = 2, sum = 0;
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        sum += a;
        a = 10 * a + 2;
    }
    printf("%d", sum);
    return 0;
}